package pl.PawelAndAlicja.badugiproject.main.Players;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class PlayerTest {

	FactoryPlayer factoryPlayer;
    ClientPlayer clientPlayer;

    Player casinoPlayer;
    Player humanPlayer;
    Player botPlayer;
    
	@Before
	public void setUp() throws Exception {
		factoryPlayer = new FactoryPlayer();
		clientPlayer = new ClientPlayer(factoryPlayer);
		casinoPlayer = clientPlayer.createPlayer("Casino");
		humanPlayer = clientPlayer.createPlayer("Human");
		botPlayer = clientPlayer.createPlayer("Bot");
	}

	@After
	public void tearDown() throws Exception {
		factoryPlayer = null;
		clientPlayer = null;
		casinoPlayer = null;
		humanPlayer = null;
		botPlayer = null;
	}

	@Test
	public void casinoTest() {
		assertEquals(casinoPlayer.getTypePlayer(),"Casino player");
		
		int prizeTokens = Integer.parseInt(casinoPlayer.getPrizeTokens());
		assertEquals(prizeTokens,10000);
	}
	
	@Test
	public void humanTest() {
		assertEquals(humanPlayer.getTypePlayer(),"Human player");
		
		int prizeTokens = Integer.parseInt(humanPlayer.getPrizeTokens());
		assertEquals(prizeTokens,2500);
	}
	
	@Test
	public void botTest() {
		assertEquals(botPlayer.getTypePlayer(),"Bot player");
		
		int prizeTokens = Integer.parseInt(botPlayer.getPrizeTokens());
		assertEquals(prizeTokens,4000);
	}
}
